/*
 * @Author: TuYongTao
 * @Date: 2021-10-29 18:48:00
 * @LastEditors: your Name
 * @LastEditTime: 2021-10-29 18:56:12
 * @Description: 
 */

export default class Dep {
  static target
  constructor() {
    // 存放观察者 watcher
    this.subs = []
  }
  addSub(sub) {
    if(sub && sub.update) {
      this.subs.push(sub)
    }
  }
  notify() {
    this.subs.forEach((sub)=>{
      sub.update()
    })
  }
}
